﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.Entities.EC
{
    /// <summary>
    /// 能源信息管理实体
    /// </summary>
    public class Energy : BaseEntity<string>
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        public override string Id { get; set; }

        /// <summary>
        /// 设备名称
        /// </summary>
        public string? DevName { get; set; }

        /// <summary>
        /// 工厂名称
        /// </summary>
        public string? FactoryName { get; set; }

        /// <summary>
        /// 车间名称
        /// </summary>
        public string? Workshop { get; set; }

        /// <summary>
        /// 产线名称
        /// </summary>
        public string? ProductionLine { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 物质、介质（电/水/气/汽/油等）
        /// </summary>
        public string? Substance { get; set; }

        /// <summary>
        /// 能耗量
        /// </summary>
        public decimal? EnergyConsumption { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string? Unit { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string? Remaker { get; set; }

        /// <summary>
        /// 是否删除 （此处不需要
        /// </summary>
        public bool IsDeleted { get; set; }


        #region 拓展字段
        /// <summary>
        /// 时间类型选择 （年、月、日）
        /// </summary>
        [NotMapped]
        public string? TimeType { get; set; }
        /// <summary>
        /// 时间范围
        /// </summary>
        [NotMapped]
        public string? TimeCondition { get; set; }

        /// <summary>
        /// 数据列名
        /// </summary>
        [NotMapped]
        public string[] SelectedColumns { get; set; }

        /// <summary>
        /// 时间类型值显示
        /// </summary>
        [NotMapped]
        public string? DateTimeType { get; set; }
        #endregion
        /// <summary>
        /// 构造函数 - 自动生成GUID
        /// </summary>
        public Energy()
        {
            // 如果ID为空，自动生成GUID
            if (string.IsNullOrEmpty(Id))
            {
                Id = Guid.NewGuid().ToString();
            }
        }
    }

    /// <summary>
    /// 看板所需参数（设备）
    /// </summary>
    public class device
    {
        /// <summary>
        /// 设备名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 设备名称的能耗
        /// </summary>
        public decimal EnergyConsumption { get; set; }
    }
    /// <summary>
    /// 车间
    /// </summary>
    public class workshop
    {
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        ///名称的能耗
        /// </summary>
        public decimal EnergyConsumption { get; set; }
    }
    /// <summary>
    /// 产线
    /// </summary>
    public class productionLine
    {
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 名称的能耗
        /// </summary>
        public decimal EnergyConsumption { get; set; }
    }
    /// <summary>
    /// 物质
    /// </summary>
    public class substance
    {
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 名称的能耗
        /// </summary>
        public decimal EnergyConsumption { get; set; }
    }

}